#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <memory>

QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE

namespace cyclone::parser{
class AstToJson;
}
class AstViewModel;
class QSettings;
class SelectionListModel;
enum ViewerMode{
    Auto,
    Loose,
    Formal,
};
Q_DECLARE_METATYPE(ViewerMode);

enum RuleToApply{
    Program,
    LeftValue,
    RightValue,
    VarDecl,
};

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);

    ~MainWindow();
protected:
    bool eventFilter(QObject *watched, QEvent *event);

private:
    Ui::MainWindow *ui;
    std::unique_ptr<cyclone::parser::AstToJson> antlrParser_;
    AstViewModel* antlrParserModel_;
    AstViewModel* acornParserModel_;
    std::unique_ptr<QSettings> setting_;
    SelectionListModel* modelSelectedMode_;
    SelectionListModel* modelSelectedRule_;
    ViewerMode mode_ = ViewerMode::Auto;
    std::string selectedRule_;
    bool parseLoose_;
};
#endif // MAINWINDOW_H
